<div id="footer" class="layout">
    <p>&copy; Copyright <?php echo SITE_NAME . " " . date("Y"); ?>. All rights reserved</p>
    <div class="f-nav">
        <ul>
            <li><a href="<?php echo $this->baseUrl("static/about_us"); ?>">About Us</a>|</li>
            <li><a href="<?php echo $this->baseUrl("static/terms"); ?>">Terms of Use</a>|</li>
            <li><a href="<?php echo $this->baseUrl("static/privacy_policy"); ?>">Privacy Policy</a>|</li>
            <li><a href="#">Contact Us</a></li>
        </ul>
        <div class="cf"></div>
    </div>
</div>
<a id="alert" href="#alert-msg" style="display:none;">alert</a>
<a id="confirmBox" href="#confirm-msg" style="display:none;">confirm</a>

<div id="alert-msg" class="alert-message" style="z-index: 1000;">
    <div class="am-wrapper">
        <a href="#close" class="close-button"></a>
        <div class="title">
            Alert <strong>Message</strong>
        </div>
        <div class="content">
            Are you <strong>SURE</strong> you want to leave this Event?
        </div>
        <!--                <div class="buttons">
                            <a href="#" class="bluefbutton fl">Cancel</a>
                            <a href="#" class="yefbutton fl">Leave</a>
                            <div class="cf"></div>
                        </div>-->
    </div>
</div>
<div id="confirm-msg" class="alert-message">
    <div class="am-wrapper">
        <a href="#close" class="close-button"></a>
        <div class="title">
            Alert <strong>Message</strong>
        </div>
        <div class="content">
            Are you <strong>SURE</strong> you want to leave this Event?
        </div>
        <div class="buttons">
            <a href="#" class="bluefbutton fl Cancel" rel="false">No</a>
            <a href="#" class="yefbutton fl confirm" rel="true">Yes</a>
            <div class="cf"></div>
        </div>
    </div>
</div>
</div>

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>
<script>
    var input = document.getElementById('address');
    var autocomplete = new google.maps.places.Autocomplete(input);
</script>

<script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.tabify.js"></script>

<script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.switchImg.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH; ?>/jquery.toolTips.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH; ?>/scripts.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $(".tab-menu").tabify();

        $(".remove-icon").click(function() {
            $(".messageError").remove();
            $(".messageSuccess").remove();
        });
        
        $('#register_link').click(function(){
            
            close_login();
            $('#caccount-button').click();
        })
       
       $('#account_link').click(function(){
           close_register();
           $('#login-button').click();
       })
        
        $("#register-btn").click(function(event) {
            event.preventDefault();
            var fname = $("input#register_fname").val();
            if (fname == "First Name")
                fname = "";
            var lname = $("input#register_lname").val();
            if (lname == "Last Name")
                lname = "";
            var username = $("input#register_username").val();
            if (username == "Username")
                username = "";
            var email = $("input#register_email").val();
            if (email == "Email Address")
                email = "";
            var pass = $("input#register_password").val();
            if (pass == "Password")
                pass = "";

            if (fname != "" && lname != "" && username != "" && email != "" && pass != "")
            {
                var register_form_ser = $("#register-form").serialize();
                $("#register-btn").html("Loading...");
                $.ajax({
                    type: "POST",
                    url: "<?php echo $this->baseUrl("ajax/register"); ?>",
                    data: register_form_ser,
                    success: function(response) {
                        if (response == "1")
                        {
                            window.location.href = "<?php echo $this->baseUrl(''); ?>";
                        }
                    }
                });
            }
        });

        $("#reset-pass-btn").click(function(event) {
            event.preventDefault();
            $("#reset-pass-btn").html("Loading...");
            var user_email = $("#reset-pass-email").val();
            if (user_email != "")
            {
                $.ajax({
                    type: "POST",
                    url: "<?php echo $this->baseUrl("ajax/forgotpassword"); ?>",
                    data: {"user_email": user_email},
                    success: function(response) {
                        if (response == "1")
                        {
                            window.location.href = "<?php echo $this->baseUrl(''); ?>";
                        }
                    }
                });
            }
        });

        $("#login-btn").click(function(event) {
            event.preventDefault();

            var login_email = $("input#login_email").val();
            if (login_email == "Email Address")
                login_email = "";
            var login_pass = $("input#login_pass").val();
            if (login_pass == "Password")
                login_pass = "";

            if (login_pass != "" && login_email != "")
            {
                var login_form_ser = $("#login-form").serialize();
                $("#login-btn").html("Loading...");
                $.ajax({
                    type: "POST",
                    url: "<?php echo $this->baseUrl("ajax/login"); ?>",
                    data: login_form_ser,
                    success: function(response) {
                        if (response == "1")
                        {
                            window.location.href = "<?php echo $this->baseUrl(''); ?>";
                        }
                    }
                });
            }
        });

        $(".updateSocialUsername").click(function(event) {
            event.preventDefault();
            var social_network = $(this).attr("rel");
            var username = $("#" + social_network + "-username").val();
            if (username != "")
            {
                $(".please-wait").show();
                var url = "<?php echo $this->baseUrl("profile/updatesocialusername?social_network="); ?>" + social_network + "&username=" + username;
                window.location.href = url;
            }
        });

        $(".inviteToEvent .bookmark").live("click", function(event) {
            event.preventDefault();
            var user_id = $(this).attr("id");
            var event_id = $(this).attr("rel");
            var url = "<?php echo $this->baseUrl("ajax/eventinvite?event_id="); ?>" + event_id + "&user_id=" + user_id;
            $.ajax({
                url: url
            });
            $(this).addClass("uncheck");
            $(this).removeClass("bookmark");
            $(this).html("Shared");
        });

        $(".inviteToEvent .uncheck").live("click", function(event) {
            event.preventDefault();
            var event_id = $(this).attr("rel");
            var user_id = $(this).attr("id");
            $.ajax({
                type: "POST",
                url: "<?php echo $this->baseUrl("ajax/removesharedevent"); ?>",
                data: {"event_id": event_id, "user_id": user_id}
            });
            $(this).addClass("bookmark");
            $(this).removeClass("uncheck");
            $(this).html("Share event");
        });

    });
</script>
<script type="text/javascript" src="<?php echo JS_PATH; ?>/function.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH; ?>/app.js"></script>

</body>
</html>
